<%@page import="Model.Bean.Phone"%>
<%@page import="Model.Util.PhoneModel"%>
<%@page import="java.util.ArrayList"%>
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<%//@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c" %>
<%//@ taglib uri="http://java.sun.com/jstl/fmt_rt" prefix="fmt" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
</head>
<body>
	<fmt:setBundle var="b" basename="myapp" scope="session"/>
	<jsp:include page="frmAHeader.jsp"></jsp:include>	
	
	<div>
		<%
		ArrayList<Phone> ps = new PhoneModel().ShowAllPhone();				
		
		for(int i = 0; i < 10; i++) 
		{
			%>
				<div>
					<table>
						<tr>
							<td>
								<a href="frmAEditPhone.asp?phoneID=<%=ps.get(i).getPhoneID() %>"><%=ps.get(i).getPhoneName() %></a>
							</td>
						</tr>
						<tr>
							<td>
								<img src="<%=ps.get(i).getPicture() %>" />
							</td>
						</tr>
						<tr>
							<td>
								<%=ps.get(i).getPrice() %>
							</td>
						</tr>
						<tr>
							<td>
								<form action="AEditPhone.jsp" method="post">
									<input type="text" name="PhoneID" value="<%=ps.get(i).getPhoneID() %>"/>
									<input type="submit" value="<fmt:message key="AMPhone.Edit" bundle="${ b }"/>"/>
								</form>
								<form  action="DeletePhoneAction" method="post">
									<input type="text" value="<%=ps.get(i).getPhoneID() %>"/>
									<input type="submit" value="<fmt:message key="AMPhone.Delete" bundle="${ b }"/>"/>
								</form>
							</td>
						</tr>
					</table>
				</div>
			<%
		}		
    	%>
	</div>
	
	<jsp:include page="frmAFooter.jsp"></jsp:include>	
</body>
</html>